import maya.cmds as mc
class RC_scripts():
    def rotateOrderWindow(self):
        rotateOrderWindow = 'rotateOrderWindow'
        if mc.window(rotateOrderWindow,ex = True):
            mc.deleteUI(rotateOrderWindow)
        
        mc.window(rotateOrderWindow,widthHeight=(300, 200),t='rotate Order Window_v1.01',menuBar = True,rtf=True,s=True)

        mc.rowColumnLayout('Main',numberOfColumns=1,w=300,cal = (5,'center'),m=True)
        mc.button('add rotateOrder',c=lambda *args:self.addRotateOrder())
        mc.rowColumnLayout('orderLout',numberOfColumns=2,w=300,cal = (5,'center'),m=True)
        mc.optionMenu('OrderMenu',label='',w=150,h=30)
        

        mc.menuItem( label='xyz' )
        mc.menuItem( label='yzx' )
        mc.menuItem( label='zxy' )
        mc.menuItem( label='xzy' )
        mc.menuItem( label='yxz' )
        mc.menuItem( label='zyx' )
        
        mc.button(l='change defaultValue',w=150,c= lambda *args:self.setDV())

        mc.showWindow()
    #rotateOrderWindow()
        
    def addRotateOrder(self):
        slobj=mc.ls(sl=True)
        for i in slobj:
            mc.addAttr(i,ln='rotate_order',at='enum',en='xyz:yzx:zxy:xzy:yxz:zyx:',k=True)
            mc.connectAttr(str(i)+'.rotate_order',str(i)+'.rotateOrder')
    def setDV(self):
        slobj=mc.ls(sl=True)
        selValue=mc.optionMenu('OrderMenu',q=True,sl=True)
        for i in slobj:
            mc.addAttr(str(i)+'.rotate_order',e=True,dv=selValue-1)